home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / endprn / endprn.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  1.4 KB  |  49 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1590
  5.    ClientLeft      =   3660
  6.    ClientTop       =   1485
  7.    ClientWidth     =   2055
  8.    Height          =   1995
  9.    Left            =   3600
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1590
  13.    ScaleWidth      =   2055
  14.    Top             =   1140
  15.    Width           =   2175
  16.    Begin CommandButton Command1 
  17.       Caption         =   "Abort Print Job"
  18.       Height          =   495
  19.       Left            =   120
  20.       TabIndex        =   0
  21.       Top             =   960
  22.       Width           =   1815
  23.    End
  24.    Begin CommandButton Command2 
  25.       Caption         =   "Start Print Job"
  26.       Height          =   495
  27.       Left            =   120
  28.       TabIndex        =   1
  29.       Top             =   240
  30.       Width           =   1815
  31.    End
  32. Sub Command1_Click ()
  33. On Error GoTo NoPrintMan 'Handles case where PrintMan not running
  34. AppActivate "Print Manager" 'Makes PrintMan the active app
  35. SendKeys "%{ }{Down 5}%{F4}{Enter}", 1 'Sends keys to close PrintMan, assuming PrintMan is minimized
  36. GoTo EndIt
  37. NoPrintMan:
  38. MsgBox "The Print Manager is not running, or no printing is in progress!"
  39. Resume EndIt
  40. EndIt:
  41. End Sub
  42. Sub Command2_Click ()
  43. For x = 1 To 60
  44.     Printer.Print "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"
  45. Next x
  46. Printer.NewPage
  47. Printer.EndDoc
  48. End Sub
  49.